package showhow.simple.common.enums;

/**
 * 错误代码枚举
 *
 * @author dengqiongchuan
 * @date 2022-03-31
 */
public enum ErrorCode {
    SUCCESS(200, "请求成功"),
    UNAUTHORIZED(401, "请登录"),

    ERROR_CODE_OBJECT_IS_NULL(100000, "ErrorCode IS NULL"),
    ERROR_CODE_UNDEFINED(100001, "ErrorCode Undefined"),

    REQUET_PARAM_VERIFY_FAILURE(100011, "请求参数校验失败"),
    USER_NAME_NOT_EXISTS(100012, "用户名不存在"),
    PASSWORD_INCORRECT(100013, "密码错误"),
    DUPLICATE_USERNAME(100014, "用户名重复"),


    UNKNOWN_EXCEPTION(999999, "未知异常");

    private final int code;
    private final String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
